<%@ Control Language="C#" AutoEventWireup="true" CodeFile="edit.ascx.cs" Inherits="widgets_Quotations_edit" %>

<fieldset>
  <legend>Add new quotation</legend>
    <table>
        <tr>
        <td><label for="<%=txtQuotation.ClientID %>">Quotation</label></td>
        <td><asp:TextBox runat="server" ID="txtQuotation" Width="400px" Height="40px" Wrap="true" TextMode="MultiLine" Font-Names="Verdana" Font-Size="11px" />
  <asp:RequiredFieldValidator runat="Server" ControlToValidate="txtQuotation" ErrorMessage="*" ValidationGroup="add" Display="Dynamic" /><br />
</td>
        <td>
  <asp:Button runat="server" ID="btnAdd" Text="Add quotation" ValidationGroup="add" />
</td>
        </tr>
        
        <tr>
        <td><label for="<%=txtAuthor.ClientID %>">Author</label></td>
        <td><asp:TextBox runat="server" ID="txtAuthor" Width="200px" Text="" /></td>
        <td>&nbsp;</td>
        </tr>
        
        <%// lastshown is for future use %>
        <tr visible="false" style="visibility:collapse;">
        <td><label for="<%=txtLastShown.ClientID %>">Last Shown</label></td>
        <td><asp:TextBox runat="server" ID="txtLastShown" Width="100px" Text="" />
 <asp:RegularExpressionValidator runat="server" ControlToValidate="txtLastShown" ErrorMessage="Please enter a valid date" ValidationGroup="add" Display="Dynamic" ValidationExpression="<%=ValidationExpression.DateTime %>" />
</td>
        <td>&nbsp;</td>
        </tr>
    </table>
   
</fieldset>

<br />
<asp:Label ID="lblError" runat="server" Visible="false" ForeColor="Red"></asp:Label>
<asp:GridView runat="server" ID="grid" CellPadding="2"
    Width="100%"
    AutoGenerateColumns="False" 
    AlternatingRowStyle-CssClass="alt" 
    AlternatingRowStyle-BackColor="#F1F1F1"
    AutoGenerateDeleteButton="True" 
    AutoGenerateEditButton="True" AllowPaging="True" PageSize="8">
    <EmptyDataTemplate>
        There are no quotes.&nbsp; Use the form above to add a new quote.
    </EmptyDataTemplate>
 <HeaderStyle HorizontalAlign="left" />
 <Columns>
 
  <asp:TemplateField HeaderText="Quotation">
    <ItemTemplate>
      <%# Eval("quotation") %>
    </ItemTemplate>
    <EditItemTemplate>
      <asp:TextBox runat="server" ID="txtQuotation" Width="95%" Text='<%# Eval("quotation") %>' Height="40px" Wrap="true" TextMode="MultiLine" Font-Names="Verdana" Font-Size="11px" />
  <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="Server" ControlToValidate="txtQuotation" ErrorMessage="Please enter a quotation"  Display="Dynamic" />
    </EditItemTemplate>
      <ItemStyle Width="75%" />
  </asp:TemplateField>
  
  <asp:TemplateField HeaderText="Author">
    <ItemTemplate>
      <%# Eval("author")%>
    </ItemTemplate>
    <EditItemTemplate>
      <asp:TextBox runat="server" ID="txtAuthor" Width="95%" Text='<%# Eval("author") %>' />
    </EditItemTemplate>
      <ItemStyle Width="15%" />
  </asp:TemplateField>
  
  <asp:TemplateField HeaderText="Last Shown" Visible="false">
    <ItemTemplate>
      <%# Eval("lastshown")%>
    </ItemTemplate>
    <EditItemTemplate>
      <asp:TextBox runat="server" ID="txtLastShown" Width="95%" Text='<%# Eval("lastshown") %>' />
 <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtLastShown" ErrorMessage="Please enter a valid date" Display="Dynamic" ValidationExpression="<%=ValidationExpression.DateTime %>" />
    </EditItemTemplate>
      <ItemStyle Width="15%" />
  </asp:TemplateField>
 
 </Columns>

<AlternatingRowStyle BackColor="#F1F1F1" CssClass="alt"></AlternatingRowStyle>
</asp:GridView>